<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>
<body>
    
</body>
<script>
    let arr = [22,33]
    arr[2]=1,
    console.log(arr);


    let obj = {a:1}
    obj.b = 22
    obj['c']=33
    console.log(obj);

    console.dir(arr);//dir打印原型
    // 检测属性
    console.log(arr.hasOwnProperty(1));
    console.log(obj.hasOwnProperty('a'));
    console.log(arr.hasOwnProperty('length'));
    console.log(arr);
    console.log(arr.constructor);//查看原型
    console.log(obj.constructor);

    console.log(typeof arr,typeof obj);//typeof检测不出来对象

    console.log(arr instanceof Array);
    console.log(arr instanceof Object);
    console.log(obj instanceof Array);
    console.log(obj instanceof Object);

    console.log(Object.prototype.toString.call(arr));//终极方法检测原型链上是否有关系 从原型改变对象指向
    console.log(Object.prototype.toString.call(obj));
</script>
</html>